<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            position: relative;
            height: 230px;
            width: 600px;
            border-bottom: 2px solid black;
            transform-style: preserve-3d;
            perspective: 400px;
            margin: 100px auto;

        }
        .box div{
            position: absolute;
            height: 200px;
            width: 60px;
            line-height: 200px;
            text-align: center;
            top: 0;
            left: 270px;
            transform-origin: center bottom;
            transition: all .5s;
        }
        .box div:nth-of-type(1){
            background: #AF05AA;
        }
        .box div:nth-of-type(2){
            background: #ca141d;
        }
        .box div:nth-of-type(3){
            background: #ff5000;
        }
        .box div:nth-of-type(4){
            background: #0ea432;
        }
        .box div:nth-of-type(5){
            background: #986b0d;
        }
        .box div:nth-of-type(6){
            background: #35b1ff;
        }
        .box div:nth-of-type(7){
            background: #fad65c;
        }

        .box div:nth-of-type(8){
            background: #35b1ff;
        }
        .box div:nth-of-type(9){
            background: #986b0d;
        }
        .box div:nth-of-type(10){
            background: #0ea432;
        }
        .box div:nth-of-type(11){
            background: #ff5000;
        }
        .box div:nth-of-type(12){
            background: #ca141d;
        }
        .box div:nth-of-type(13){
            background: #AF05AA;
        }

        .box:hover div:nth-of-type(13){
            transform: rotate(90deg);
        }
        .box:hover div:nth-of-type(12){
            transform: rotate(75deg);
        }
        .box:hover div:nth-of-type(11){
            transform: rotate(60deg);
        }
        .box:hover div:nth-of-type(10){
            transform: rotate(45deg);
        }
        .box:hover div:nth-of-type(9){
            transform: rotate(30deg);
        }
        .box:hover div:nth-of-type(8){
            transform: rotate(15deg);
        }
        .box:hover div:nth-of-type(7){
            transform: rotate(0deg);
        }
        .box:hover div:nth-of-type(6){
            transform: rotate(-15deg) translateZ(-1px);
        }
        .box:hover div:nth-of-type(5){
            transform: rotate(-30deg) translateZ(-1px);
        }
        .box:hover div:nth-of-type(4){
            transform: rotate(-45deg) translateZ(-1px);
        }
        .box:hover div:nth-of-type(3){
            transform: rotate(-60deg) translateZ(-1px);
        }
        .box:hover div:nth-of-type(2){
            transform: rotate(-75deg) translateZ(-1px);
        }
        .box:hover div:nth-of-type(1){
            transform: rotate(-90deg) translateZ(-1px);
        }
    </style>
</head>
<body>
<div class="box">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
    <div>7</div>
    <div>6</div>
    <div>5</div>
    <div>4</div>
    <div>3</div>
    <div>2</div>
    <div>1</div>
</div>
</body>
</html>